// pages/profile/profile.js
Page({
  data: {
    collectGoods: []
  },
  onLoad: function() {
    this.loadCollectGoods();
  },
  onShow: function() {
    this.loadCollectGoods();
  },
  loadCollectGoods: function() {
    const collectList = wx.getStorageSync('collectList') || {};
    const goodsIds = Object.keys(collectList).filter(goodsId => collectList[goodsId]);
    this.setData({
      collectGoods: goodsIds.map(goodsId => ({ goods_id: goodsId }))
    });
  },
  goToCollectPage: function() {
    wx.navigateTo({
      url: '/pages/collect/collect'
    });
  },
  goToOrderPage: function() {
    wx.navigateTo({
      url: '/pages/order/order'
    });
  },
})